function empty(obj) {
    if (typeof obj == 'undefined') return true;
    if (obj === "0" || obj === "" || obj === null || obj === false) return true;
    if (typeof obj == 'number' && (isNaN(obj) || obj == 0)) return true;
    if (typeof obj == 'object' && obj.length == 0) return true;
    if (obj instanceof Date && isNaN(Number(obj))) return true;
    return false;
}

function fixFooter(){
    var myHeight = $(window).height() - $('#footer').height() - $('#header').height() - 70;				 
    $('#content').css("min-height", myHeight);		 	  
}

function moveLabel(id) {
    $("#" + id).animate({
        'margin-left': '10'
    }).delay(1000).animate({
        'margin-left': '0'
    });
}

function displayError(id, msj) {
    $("#" + id).text(msj).fadeIn().delay(1000).fadeOut(1000);
}

var normalize = (function() {
    var from = "ÃÀÁÄÂÈÉËÊÌÍÏÎÒÓÖÔÙÚÜÛãàáäâèéëêìíïîòóöôùúüûÑñÇç",
    to   = "AAAAAEEEEIIIIOOOOUUUUaaaaaeeeeiiiioooouuuunncc",
    mapping = {};
 
    for(var i = 0, j = from.length; i < j; i++ )
        mapping[ from.charAt( i ) ] = to.charAt( i );
 
    return function( str ) {
        var ret = [];
        for( var i = 0, j = str.length; i < j; i++ ) {
            var c = str.charAt( i );
            if( mapping.hasOwnProperty( str.charAt( i ) ) )
                ret.push( mapping[ c ] );
            else
                ret.push( c );
        }
        return ret.join( '' );
    }
 
})();